package cn.codergege.demo.batch

import cn.codergege.demo.entity.Person
import org.springframework.jdbc.core.RowMapper
import java.sql.ResultSet

class PersonRowMapper: RowMapper<Person> {
    val ID_COL = "id"
    val NAME_COL = "name"
    val EMAIL_COL = "email"

    override fun mapRow(rs: ResultSet, rowNum: Int): Person? {
        val person = Person(
            rs.getInt(ID_COL),
            rs.getString(NAME_COL),
            null,
            null,
            rs.getString(EMAIL_COL),
            "")
        return person
    }

}